class  Phone:
    def __init__(self,dl=100):
        self.dl=dl
    #打游戏
    def playGame(self):
        if self.dl<10:
            self.chongDian()  #充电
        else:
            self.dl-=10
    #听歌
    def music(self):
        if self.dl<5:
            self.chongDian()  # 充电
        else:
            self.dl-=5
    #打电话
    def daPhone(self):
        if self.dl < 4:
            self.chongDian()  # 充电
        else:
             self.dl-=4
    #接电话

    def jiePhone(self):
        if self.dl < 3:
            self.chongDian()  # 充电
        else:
            self.dl -= 3
    #充电

    def chongDian(self):
        if self.dl==100:
            print("电量已满")
        else:
            self.dl=100


#调用
p1=Phone()   #100
p1.playGame()
p1.music()
p1.jiePhone()
print(p1.dl)

p2=Phone()   #100


